<template>
  <div class="_article-box _cart _wrapper">
    <div class="_text-a-r">
      <el-button
        type="primary"
        @click="
          $comStore.comWin.openWin(
            {
              name: '发布内容',
              code: 'ToolVditor',
              full: false,
            },
            {
              type: 3,
            }
          )
        "
        >添加</el-button
      >
      <el-button type="primary" @click="init()">刷新</el-button>
    </div>
    <div
      class="article-item _border _radius-15p _line _flex _m-t-10"
      v-for="item in rows"
      :key="item.id"
      @click="
        $comStore.comWin.openWin(
          {
            name: '发布内容',
            code: 'ToolVditor',
            full: false,
          },
          {
            id: item.id,
          }
        )
      "
    >
      <div>{{ item.title }}</div>
      <div>{{ $dayjs(item.created_date).format() }}</div>
    </div>
  </div>
</template>
<script>
import ToolAction from "@/tool/http/tool-action.js";
const accountContentAction = ToolAction.init("account_content");
export default {
  data() {
    return {
      rows: [],
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      accountContentAction
        .list({
          rules: {
            type__in: "3",
          },
        })
        .then((res) => {
          this.rows = res;
        });
    },
  },
};
</script>
<style scoped>
._article-box {
  padding: 0 10%;
}
.article-item {
  width: 100%;
  border: 4px solid rgb(29, 152, 239);
  font-weight: bold;
  padding: 5px 20px;
}
</style>
